home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.01 Jan 88 / mpw source stuff / for Tools folder / Man < prev    next >
Encoding:
Text File  |  1987-09-14  |  1.1 KB  |  42 lines  |  [TEXT/MPS ]

  1. ###            MPW command "man" for on-line help
  2. ###                Written 1987 W.G. Powell
  3. ###                    for MacTutor
  4. ###        Search more than one file sequentially for help text
  5.  
  6. Set Exit 0
  7. Set Reval 0
  8. ###     Get standard command names from alias dictionary
  9. # need temporary file
  10. Set _dmfl_ dumrxfx_
  11. #    Unalias the input arguments
  12. Echo {Parameters} | Canon "{MPW}billTools:Alias.Dict" > "{_dmfl_}"
  13. #    Set new input arguments
  14. Set HelpList "`Catenate {_dmfl_}`"
  15. Delete -n {_dmfl_}
  16. ###        Look for each requested item individually
  17. For HelpItem In {HelpList}
  18.     # Look in default help file first
  19.     Help {HelpItem} ≥ Dev:Null
  20.     Set Retval {Status}
  21.     If ({Retval} == 2 || {Retval} == 1)
  22.         # Look in local help file if not in default
  23.         Help -f "{MPW}Local.Help" {HelpItem} ≥ Dev:Null
  24.         Set Retval {Status}
  25.     End
  26.     If ({Retval} != 0)
  27.         # Keep a list of items NOT found for diagnostic
  28.         Set Reval {Retval}
  29.         Set NotFnd "{NotFnd} {HelpItem}"
  30.     End
  31. End
  32. ###        Send error message if items not found.
  33. If ({Reval} != 0)
  34.     Echo "### Help:  Cannot find items:">Dev:StdErr
  35.     Echo "###        {NotFnd}">Dev:StdErr
  36. End
  37. Unset NotFnd
  38. Unset _dmfl_
  39. Unset HelpItem
  40. Unset HelpList
  41. Unset Retval
  42. Exit {Reval}